package secondquestion;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class Test {
    public static void main(String[] args) {
        InetAddress[] address = null;
        try {
            address=InetAddress.getAllByName("www.baidu.com");
            System.out.println("所有服务器地址");
            for (InetAddress ip: address) {
                System.out.println(ip);
            }
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
    }
}
